﻿<Page
    x:Class="GuitarFX.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:GuitarFX"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">
    <Page.Resources>
        <local:DbToRatioConverter x:Key="DbToRatioConverter"/>
        <local:MsToTimeSpanConverter x:Key="MsToTimeSpanConverter"/>
     </Page.Resources>
    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
    	<Grid.RowDefinitions>
    		<RowDefinition/>
    		<RowDefinition Height="7*"/>
    	</Grid.RowDefinitions>
    	<TextBlock HorizontalAlignment="Left" Grid.Row="0" TextWrapping="Wrap" Text="Delay FX" VerticalAlignment="Center" Style="{StaticResource HeaderTextBlockStyle}" Margin="50,0,0,0"/>
    	<Border Grid.Row="1" CornerRadius="20" BorderThickness="5" BorderBrush="#FFC7C7C7" Padding="20" Margin="50,0,50,50">
    		<Grid>
    			<StackPanel Orientation="Horizontal" >
					<Border Margin="25" CornerRadius="25" BorderThickness="1" BorderBrush="{ThemeResource ButtonBorderThemeBrush}">
    					<StackPanel Orientation="Vertical" Margin="25">
    						<StackPanel Orientation="Horizontal" VerticalAlignment="Top">
    							<ToggleSwitch Header="Power"  x:Name="PowerSwitch" Toggled="ToggleSwitch_Toggled"/>
    							<Ellipse Width="20" Height="20" x:Name="PowerLed" Margin="10,20,20,0" Fill="DarkGray"/>
    						</StackPanel>
    						<Slider x:Name="SliderMasterVolume"  Header="Master Volume" Maximum="10" Minimum="-120" VerticalAlignment="Top"  LargeChange="20" SmallChange="3" StepFrequency="3" TickFrequency="10" Orientation="Horizontal" TickPlacement="Outside" Value="{Binding MasterVolume, Converter={StaticResource DbToRatioConverter}, Mode=TwoWay}" Margin="0,50,0,0"/>
    					</StackPanel>
    				</Border>
    				<Border Margin="25" CornerRadius="25" BorderThickness="1" BorderBrush="{ThemeResource ButtonBorderThemeBrush}">
                        <StackPanel Orientation="Vertical" Margin="25">
                            <Slider x:Name="DelayTime" Width="200" Header="Delay Time" Maximum="1000" Minimum="10" VerticalAlignment="Top"  LargeChange="100" SmallChange="10" StepFrequency="100" TickFrequency="100" Orientation="Horizontal" TickPlacement="Outside" Value="{Binding DelayTime, Converter={StaticResource MsToTimeSpanConverter}, Mode=TwoWay}"/>
    						<Slider x:Name="DelayFeedback" Width="200"  Header="Feedback" Maximum="0" Minimum="-40" VerticalAlignment="Top"  LargeChange="10" SmallChange="1" StepFrequency="3" TickFrequency="10" Orientation="Horizontal" TickPlacement="Outside" Value="{Binding DelayFeedback, Converter={StaticResource DbToRatioConverter}, Mode=TwoWay}"/>
    					</StackPanel>

    				</Border>

    			</StackPanel>

    		</Grid>
    	</Border>
    	<TextBlock TextWrapping="WrapWholeWords" Foreground="Red" x:Name="ErrorText" VerticalAlignment="Bottom" HorizontalAlignment="Center" Grid.Row="1" Margin="0,0,0,20"/>
	</Grid>
</Page>
